package kr.hkit.powerjava.chapter22.work4.vo;

public class Student {
	private int StdNum;
	private String StdName;
	private int kor;
	private int eng;
	private int math;
	
	public Student(int stdNum, String stdName) {
		this.StdNum = stdNum;
		this.StdName = stdName;
	}
	public Student(int stdNum, String stdName, int kor, int eng, int math) {
		this.StdNum = stdNum;
		this.StdName = stdName;
		this.kor = kor;
		this.eng = eng;
		this.math = math;
	}
	public int getStdNum() {
		return StdNum;
	}
	public void setStdNum(int stdNum) {
		StdNum = stdNum;
	}
	public String getStdName() {
		return StdName;
	}
	public void setStdName(String stdName) {
		StdName = stdName;
	}
	public int getKor() {
		return kor;
	}
	public void setKor(int kor) {
		this.kor = kor;
	}
	public int getEng() {
		return eng;
	}
	public void setEng(int eng) {
		this.eng = eng;
	}
	public int getMath() {
		return math;
	}
	public void setMath(int math) {
		this.math = math;
	}

	public double getTotal(){
		return kor+eng+math;
		
	}
	public double getavg(){
		return getTotal()/3.0;
		
	}
	
	
	@Override
	public String toString() {
		return String
				.format( "%3s\t %5s\t kor=%s, eng=%s, math=%s, getTotal()=%s, getavg()=%s",
						StdNum, StdName, kor, eng, math, getTotal(), getavg());
	}
	
}
